<?php include './application/views/common/zhs_header.php';?>

<!-- center部分 -->
<?php include './application/views/common/zhs_usercenter_acnt.php';?>
<div class="inv_box w">
<?php include './application/views/common/zhs_usercenter_left.php';?>

  <div class="membd_right" style="margin-top:0;">
  <?php if($type == 3){?>
   <form id="collForm" action="/repay/repay_detail.html" method="get">
    <div class="memhktitle mt"><h3 class="memhk_h3">应还款：
		  	开始时间：<input type="text" id="strtime" name="strtime" style="width: 100px; height:20px;" value="<?php echo $where['strtime'];?>"  onfocus="WdatePicker()" readonly="readonly"/>
			结束时间：<input type="text" id="endtime" name="endtime" style="width: 100px; height:20px;" value="<?php echo $where['endtime'];?>"  onfocus="WdatePicker()" readonly="readonly"/>
			<a href="javascript:void(0)" onclick="document.getElementById('collForm').submit();">&nbsp;&nbsp;查询</a>
			<!--<a href="/userborrow/coll.html?act=excel&strtime=<?php echo $where['strtime'];?>&endtime=<?php echo $where['endtime'];?>">导出</a>
			-->
	</h3>
    <span> <a href="/repay/repay_ydetail.html">去查 已还款</a></span></div>
    </form>
    <?php } else{?>
       <form id="collForm" action="/repay/repay_ydetail.html" method="get">
    <div class="memhktitle mt"><h3 class="memhk_h3">已还款：
		  	开始时间：<input type="text" id="strtime" name="strtime" style="width: 100px; height:20px;" value="<?php echo $where['strtime'];?>"  onfocus="WdatePicker()" readonly="readonly"/>
			结束时间：<input type="text" id="endtime" name="endtime" style="width: 100px; height:20px;" value="<?php echo $where['endtime'];?>"  onfocus="WdatePicker()" readonly="readonly"/>
			<a href="javascript:void(0)" onclick="document.getElementById('collForm').submit();">&nbsp;&nbsp;查询</a>
			<!--<a href="/userborrow/coll.html?act=excel&strtime=<?php echo $where['strtime'];?>&endtime=<?php echo $where['endtime'];?>">导出</a>
			-->
	</h3>
    <span> <a href="/repay/repay_detail.html">去查 应还款</a></span></div>
    </form>
    <?php }?>
    <div class="hk_body pt">
            <table class="membd_tab">
      <thead>
        <tr>
        
        	 <th width="190">标题</th>
			<th width="90">期数/总期数</th>
			<?php if($type == 4){?>
			<th width="160">已还时间</th>
			<th width="90">已还总额</th>
			<th width="90">已还本金</th>
			<th width="90">已还利息</th>
			<?php }else{?>
			<th width="160">应还时间</th>
			<th width="90">应还总额</th>
			<th width="90">应还本金</th>
			<th width="90">应还利息</th>
			<?php }?>
			<?php if($type == 3){?>
			<th width="60">逾期天数</th>
			<th width="90">逾期费用</th>
			<?php }elseif($type == 4){?>
			<th width="90">逾期时间</th>
			<th width="90">逾期费用</th>
       		<?php }?>
        </tr>
      </thead>
      <tbody>
         <?php foreach($repayment_list as $repay){?>
		  <tr>
			<td><a href="/borrow/zhs_obj/<?php echo $repay['borrow_id'];?>.html" class="cnxq_a<?php echo $repay['ftype'];?>"><?php echo CON_NAME;?> </a>-<?php echo $borrow_type[$repay['ftype']].$repay['borrow_id'];?></td>
			
			<td align="center"><?php echo $repay['forder']+1;?>/<?php if(3== $repay['style']) echo 1 ;else echo $repay['time_limit'];?></td>
			<?php if($type == 4){?>
			<td><?php echo date('Y-m-d H:i',$repay['repayment_yestime']);?></td>
			<td>&yen;<?php echo number_format($repay['capital']+$repay['interest']+$repay['late_interest'],2);?></td>
			<td>&yen;<?php echo number_format($repay['capital'],2);?></td>
			<td>&yen;<?php echo number_format($repay['interest'],2);?></td>
			<?php }else{?>
			<td><?php echo date('Y-m-d H:i',$repay['repayment_time']);?></td>
			<td>&yen;<?php echo number_format($repay['capital']+$repay['interest']+$repay['late_interest'],2);?></td>
			<td>&yen;<?php echo number_format($repay['capital'],2);?></td>
			<td align="center">&yen;<?php echo number_format($repay['interest'],2);?></td>
			<?php }?>
			<?php if($type == 3){?>
			<?php $late_result = late_interest($repay['repay_time'], $repay['capital']>0?$repay['capital']:$repay['interest']);?>
			<td><?php echo $repay['late_days'];?>天</td>
			<td>&yen; <?php echo $repay['late_interest'];?> </td>
			<?php }elseif ($type == 4){?>
			<td><?php echo $repay['late_days'];?>天</td>
			<td>&yen; <?php echo $repay['late_interest'];?> </td>
			<?php }?>
		  </tr>
		  <?php }?>
      </tbody>
    </table>
    <div class="invbd_page"><?php echo $this->pagination->create_links();?></div>
  </div>
</div> 
</div>

<?php include './application/views/common/zhs_footer.php';?>

<?php include './application/views/common/zhs_right.php';?>